// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://ws-prepay-1536:8081/SaleDataProvider/services/WsDataOpProvider?wsdl
// Encoding : UTF-8
// Version  : 1.0
// (2007-10-09 18:23:26 - 1.33.2.5)
// ************************************************************************ //

unit WsDataOpProvider;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"



  // ************************************************************************ //
  // Namespace : http://webservice.prepay.wasion.com
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : WsDataOpProviderHttpBinding
  // service   : WsDataOpProvider
  // port      : WsDataOpProviderHttpPort
  // URL       : http://ws-prepay-1536:8081/SaleDataProvider/services/WsDataOpProvider
  // ************************************************************************ //
  WsDataOpProviderPortType = interface(IInvokable)
    ['{81D17F69-3B41-BB56-5B2C-DBFBD3AB6203}']
    function userLogon(const strUser: WideString; const strGUID: WideString; const strPassword: WideString): WideString; stdcall;
    function getServerStatus(const strUser: WideString; const strGUID: WideString): Integer; stdcall;
    function userLogout(const strUser: WideString; const strGUID: WideString; const strKey: WideString): Integer; stdcall;
    function execServiceCmd(const strUser: WideString; const strGUID: WideString; const strCmdXml: WideString): WideString; stdcall;
  end;

function GetWsDataOpProviderPortType(strHost: string; strPort: string; var wsDataOp: WsDataOpProviderPortType): THTTPRIO;

implementation

function GetWsDataOpProviderPortType(strHost: string; strPort: string; var wsDataOp: WsDataOpProviderPortType): THTTPRIO;
var
  defURL: string;
  RIO: THTTPRIO;

begin
  if strHost = '' then strHost := '127.0.0.1';
  if strPort = '' then strPort := '8081';

  defURL := 'http://' + strHost + ':' + strPort +
    '/SaleDataProvider/services/WsDataOpProvider';

  RIO := THTTPRIO.Create(nil);
  wsDataOp := (RIO as WsDataOpProviderPortType);
  RIO.URL := defURL;
  if wsDataOp = nil then
  begin
    RIO.Free;
    RIO := nil;
  end;

  Result := RIO;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(WsDataOpProviderPortType), 'http://webservice.prepay.wasion.com', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(WsDataOpProviderPortType), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(WsDataOpProviderPortType), ioDocument);
  InvRegistry.RegisterExternalParamName(TypeInfo(WsDataOpProviderPortType), 'userLogon', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(WsDataOpProviderPortType), 'getServerStatus', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(WsDataOpProviderPortType), 'userLogout', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(WsDataOpProviderPortType), 'execServiceCmd', 'out_', 'out');

end.

